<?php

$sn ="ACPZ0FC204965";
$mac ="B0:D5:9D:62:82:3E";

$enckey = 'i8e%Fvj24nz024@d!c';

$str = $sn . $mac . $enckey;


$tmp = base64_encode(md5($str,true)); //0x19 = 25

for ($i=0; $i < strlen($tmp); $i++){
    if ( ord($tmp[$i])  == 43){
        $tmp[$i] = chr(45);
    }
    if ( ord($tmp[$i])  == 47){
        $tmp[$i] = chr(95);
    }
}

echo substr($tmp, 0, 8). "\n";
